

// chrome
contrains = {audio: false, video: true}

let video = document.querySelector("video")

function successCallback(stream) {

    video.srcObject = stream
    video.play().then()
}

function errorCallback(error) {

    console.log("navigator.getUserMedia error : ", error)
}

navigator.mediaDevices.getUserMedia(contrains).then(function (stream) {

    successCallback(stream)

}).catch(function (error) {

    errorCallback(error)
})






